Skip to content

Conversation

@zhukaihan
Copy link
Collaborator

Summary

Adds option to track assignment and exposure events, or not, to fetch requests.

Checklist

  • Does your PR title have the correct title format?
  • Does your PR have a breaking change?: no

@zhukaihan
Copy link
Collaborator Author

Requires a new experiment-core version to update the version and type.

@kyeh-amp
Copy link
Collaborator

kyeh-amp commented Nov 3, 2025

I'm still getting my bearings on this, so I apologize if is a trivial question: Is the intended use for this meant for to configure tracking on a per fetch request basis or for all requests for a customer?

If this is intended to be an option for individual fetch requests to be made with and without tracking, then this seems fine. However, if the feature is meant more for a means for a user to wholesale turn on/off tracking, then it might be a better idea to set this on a client config level to prevent having to remember to set the flags for each place you might call fetch in your codebase.

@zhukaihan
Copy link
Collaborator Author

I'm still getting my bearings on this, so I apologize if is a trivial question: Is the intended use for this meant for to configure tracking on a per fetch request basis or for all requests for a customer?

If this is intended to be an option for individual fetch requests to be made with and without tracking, then this seems fine. However, if the feature is meant more for a means for a user to wholesale turn on/off tracking, then it might be a better idea to set this on a client config level to prevent having to remember to set the flags for each place you might call fetch in your codebase.

This would be for individual fetch requests. Since this is server-side SDK, and an instance of experiment SDK is shared throughout the service lifecycle, each fetch request should be for a different end user. If customer logic determine that we shouldn't track events for this user (ex. bot), then they can do it through these options.

@zhukaihan zhukaihan marked this pull request as ready for review November 17, 2025 20:55
@zhukaihan zhukaihan marked this pull request as draft November 17, 2025 20:56
@promptless
Copy link

promptless bot commented Nov 17, 2025

📝 Documentation updates detected!

New suggestion: Document FetchOptions for Node.js Experiment SDK

@kyeh-amp kyeh-amp self-requested a review November 17, 2025 22:14
@kyeh-amp
Copy link
Collaborator

Thanks for the explanation. This makes a lot more sense to me now after looking at some of the other work around this request. 🙏

"@amplitude/analytics-node": "^1.3.4",
"@amplitude/analytics-types": "^1.3.1",
"@amplitude/experiment-core": "^0.7.2",
"@amplitude/experiment-core": "^0.11.1",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to use 0.12.0 version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants